<template>
  <li class="parent-li dir-qy">
    <a class="toggle">
      <label>{{dirItem.uumsFunction.functionName}}</label>
      </a>
    <ul class="leaf-list">
      <li :is="leafHtml" v-if="leafHtmlData !== '' && showLeafCom" v-for="(leafItem,k) in leafHtmlData" :leafItem="leafItem" :key="k"></li>
    </ul>
  </li>
</template>

<script>
  import leafHtml from './leafHtml'
    export default {
      name: "dir-html",
      data(){
        return {
          leafHtml:leafHtml,
          leafHtmlData:''
        }
      },
      props:['dirItem','uapMenuVos','showLeafCom'],
      mounted(){
        if(this.uapMenuVos !== ''){
          this.leafHtmlData = [];
          for(let i = 0;i<this.uapMenuVos.length;++i){
            if(this.uapMenuVos[i].uumsFunction.parentFunction === this.dirItem.uumsFunction.functionCode){
              this.leafHtmlData.push(this.uapMenuVos[i]);
            }
          }
        }
      }
    }
</script>

<style scoped>

</style>
